--    This file is part of Ponix.
--
--    Ponix is free software: you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation, either version 3 of the License, or
--    (at your option) any later version.
--
--    Ponix is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.
--
--    You should have received a copy of the GNU General Public License
--    along with Ponix.  If not, see <http://www.gnu.org/licenses/>.
--
type_clavier = 1
y=10
type_clavier2 = 0
curentdir="ms0:/"
pdir="ms0:/"
System.currentDirectory(curentdir)
oldpad=Controls.read()
excommande=""
commande=""
usb=false  -- Useless untill "mount" is working properly.
-- It is not commented because it fucks something in script.lua and causes crashes.
while true do
screen:clear()
heur=os.date("%X")
pad=Controls.read()
screen:print(0,0,curentdir.." > "..commande.."_",blank)
aff_clavier_()
if pad:select() and oldpad:select()~=pad:select() then
commande=excommande
end
if pad:start() and oldpad:start()~=pad:start() then
parse()
excommande=commande
-- This a clean way to handle commands
-- Each commands simply calls a lua file when it's typed in by the user
-- To add a command, just add an "elseif" , then the command name and then the path of the lua file containing the
-- functions of your command.
--
--   COMMANDS
--
--
if mot[1]=="halt" then
dofile(cmd/halt.lua)
elseif mot[1]=="ls" then
dofile(cmd/ls.lua)
elseif mot[1]=="rm" then
dofile(cmd/rm.lua)
elseif mot[1]=="mkdir" then
dofile(cmd/mkdir.lua)
elseif mot[1]=="cp" then
dofile(cmd/cp.lua)
elseif mot[1]=="./" then
dofile(cmd/slashdot.lua)
elseif mot[1]=="cd" then
dofile(cmd/cd.lua)
elseif mot[1]=="uname" then
dofile(cmd/uname.lua)
else
--
--
--   ERROR MESSAGES
--
dofile(errmsgs/ba.lua)
end
end
else
dofile(errmsgs/cnf.lua)
end
end
screen.flip()
screen.waitVblankStart()
oldpad=pad
end
